﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;

using Qianwei.Model;
using Qianwei.Biz;
using Qianwei.Common.Extension;

namespace Qianwei.Web
{
    public partial class Introduction : System.Web.UI.Page
    {
        protected void Page_Load(object sender, EventArgs e)
        {
            if (!IsPostBack)
            {
                SetContent();
            }
        }

        private void SetContent()
        {
            string url = System.IO.Path.GetFileName(Request.Url.AbsolutePath);
            IList<page_info> pageinfo = PageInfoManager.Instance.QueryPageInfo(string.Format("Page_Url='{0}'" , url));
            if (pageinfo == null || pageinfo.Count == 0)
            {
                lcontenttitle.Text = "未知标题";
                lcontent.Text = "未知内容";
                return;
            }
            page_info pagenew = pageinfo.First();
            lcontenttitle.Text = pagenew.Page_Title;
            lcontent.Text = pagenew.Page_Content;
        }
    }
}